package com.java.oop;

/**
 *
 */
public class Teacher extends person{

    private String course;

    public Teacher(){
        System.out.println("Teacher无参构造函数");
    }

    public Teacher(String name, int age, String gender, String address, String course) {
        super(name, age, gender, address);
        this.course = course;
    }

    /**
     * 重写父类方法
     */
    public void speak() {
        System.out.println("同学们好！！！同学们辛苦了");
    }

    public String getCourse() {
        return course;
    }

    public void setCourse(String course) {
        this.course = course;
    }

    public void teach(){
        System.out.println("开始上课了:"+this.getName() + " 老师正在讲：" + this.getCourse());
    }

    public static void main(String[] args) {
        Teacher teacher = new Teacher("李四", 40, "男", "北京", "Java基础");
        teacher.speak();
        teacher.teach();
    }
}
